<template>
  <div>
    <div class="loans">
      <div class="loans-basic">
        <p>用户名：</p>
        <div>{{ MyPublic.loginname }}</div>
      </div>
      <div class="loans-basic">
        <p>昵称：</p>
        <div>{{ MyPublic.username }}</div>
      </div>
      <div class="loans-basic">
        <p>姓名：</p>
        <div>{{ MyPublic.name }}</div>
      </div>
      <div class="loans-basic">
        <p>驾校：</p>
        <div>{{ school }}</div>
      </div>
      <div class="loans-basic">
        <p>总课时：</p>
        <div>{{ MyPublic.zks }}</div>
      </div>
      <div class="loans-basic">
        <p>已学课时：</p>
        <div>{{ MyPublic.yxks }}</div>
      </div>
      <div class="loans-basic">
        <p>剩余课时：</p>
        <div>{{ MyPublic.syks }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { basicInformation } from "../../assets/js/api/user";
export default {
  name: "MyPublic",
  data() {
    return {
      MyPublic: {},
      // 报名状态
      school: ""
    };
  },
  mounted() {
    basicInformation().then(res => {
      // console.log(res);
      this.MyPublic = res.data;
      // console.log(this.MyPublic);
      // if (this.MyPublic.school == null) {
      //   this.school = "未报名";
      // } else {
      //   this.school = this.user.loginname;
      // }
      if (
        this.MyPublic.bmstatus == null ||
        this.MyPublic.bmstatus === "1" ||
        this.MyPublic.bmstatus === "0"
      ) {
        this.school = "未报名";
      } else {
        this.school = this.MyPublic.jxname;
      }
    });
  }
};
</script>

<style></style>
